package com.shanghaionstar.login.service;

/**
 * Created by Rengui Lu on 2017/3/17.
 */

public class LoginTransformHelper {
    public static final long ONE_HOUR_MILLIS = 60 * 60 * 1000;
    public static final long ONE_DAY_MILLIS = 24 * ONE_HOUR_MILLIS;
    public static final long THREE_DAY_MILLIS = 3 * ONE_DAY_MILLIS;

    public static final int CACHE_STATE_NOCACHE = 0x100;
    public static final int CACHE_STATE_EXPIRED = 0x101;
    public static final int CACHE_STATE_NORMAL = 0x102;
    public static final int CACHE_STATE_UPDATE = 0x103;
    public static final int CACHE_STATE_ERROR = 0x104;
    public static final int CACHE_STATE_NONE = -1;

    //    Detect cache expiration
    public static boolean detectCacheExpiration(long cacheTime) {
        long currentTime = System.currentTimeMillis();
        long diffTime = currentTime - cacheTime;
        return diffTime > THREE_DAY_MILLIS;
    }


}
